package 从中序与后序遍历序列构造二叉树;

public class Test {
    public static void main(String[] args) {
        int[] inorder = {9, 3, 15, 20, 7};
        int[] postorder = {9, 15, 7, 20, 3};
        Solution solution = new Solution();
        TreeNode root = solution.buildTree(inorder, postorder);
        traverseTree(root);
    }

    public static void traverseTree(TreeNode root) {
        if (root == null) {
            return;
        }
        System.out.print(root.val + " ");
        traverseTree(root.left);
        traverseTree(root.right);
    }
}
